
#ifndef __PUBLIC_STRING_H_
#define __PUBLIC_STRING_H_


#include "../../main.h"
#include "../../debug.h"
#include "../../include_other.h"


#define UTC_BASE_YEAR     1970
#define MONTH_PER_YEAR    12
#define DAY_PER_YEAR      365
#define SEC_PER_DAY       86400
#define SEC_PER_HOUR      3600
#define SEC_PER_MIN       60


typedef struct
{
    unsigned int  nYear;
    unsigned char nMonth;
    unsigned char nDay;
    unsigned char nHour;
    unsigned char nMin;
    unsigned char nSec;
    unsigned char DayIndex; /* 0 = Sunday */
} mytime_struct;


typedef	struct FmtIdx {
	const char *Suffix;
} FmtIdx_t;


int strcmp_c(const char *s1, const char *s2);

int __Valid_VideoFileType(const char *file);
int __Valid_PhotoFileType(const char *file);
int __Valid_MusicFileType(const char *file);



void root_set_udisk_path(char *path);
void root_get_udisk_path(char *udisk_path,int size);

void root_set_tfcard_path(char *path);
void root_get_tfcard_path(char *tfcard_path,int size);


void root_set_udisk_devpath(char *path);
void root_get_udisk_devpath(char *udisk_path,int size);

void root_set_tfcard_devpath(char *path);
void root_get_tfcard_devpath(char *tfcard_path,int size);


uint64_t root_set_tfcard_size(char *path);
uint64_t root_get_tfcard_total_size(void);
uint64_t root_get_tfcard_free_size(void);


uint64_t root_set_udisk_size(char *path);
uint64_t root_get_udisk_total_size(void);
uint64_t root_get_udisk_free_size(void);

int root_get_storage_path(char *storage_path,int size);

int32_t is_file_exit(const char *filename);


unsigned char applib_dt_is_leap_year(unsigned int year);
unsigned char applib_dt_last_day_of_mon(unsigned char month, unsigned short year);
unsigned char applib_dt_dayindex(unsigned short year, unsigned char month, unsigned char day);
void utc_sec_2_mytime(unsigned long utc_sec, mytime_struct *result, char daylightSaving);
unsigned int mytime_2_utc_sec(mytime_struct *currTime, char daylightSaving);

int generate_system_uuid(char * uuid, int size);

int file_is_png(const char *fname);
int file_is_bmp(const char *fname);
int file_is_dat(const char *fname);
int file_is_dat(const char *fname);
int file_is_mpeg(const char *fname);
int file_is_ts(const char *fname);
int modify_file_authority(const char *fname);



#endif
